{% extends "base.html" %}
{% block page_title %}修改密码{% endblock %}

{% block page_css %}
    <link href="{{ url_for('static',filename='css/check_pwd.css') }}" rel="stylesheet">
{% endblock %}

{% block page_content %}
<div class="container">
    <form action="" method="post" class="form" role="form">
        <fieldset>
        {{ form.csrf_token }}
        <div class="form-group col-md-12 required"><label class="control-label" for="current">当前密码</label>
            <input class="form-control" id="current" name="current" required type="password" value="">     
        </div>
        <div class="form-group col-md-12 required"><label class="control-label" for="new">新密码</label>      
            <input class="form-control" id="new" name="new" required type="password" value="">       
        </div>
        <div class="form-group col-md-12 required"><label class="control-label" for="confirm">确认密码</label>
            <input class="form-control" id="confirm" name="confirm" required type="password" value="">
        </div>
        <div class="form-group col-md-12 required">
            <input class="btn btn-default" id="submit" name="submit" type="submit" value="修改" onclick="return check();">
        </div>
        </fieldset>
    </form>
</div>

{% endblock %}

{% block page_script %}
<script type="text/javascript">
function check(){
   var password = document.getElementById("new").value;
   var repsword = document.getElementById("confirm").value;
   if(password != repsword) {
      alert("确认密码和新密码不一致，请重新输入");
      return false;
   }   
}
</script>
{% endblock %}